<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>flex例题</title>
    <style>
        /* .root {
            background-color: red;
            width: 500px;
            height: 100px;
            display: flex;
        }

        .child1 {
            background-color: antiquewhite;
            width: 100px;
            flex: 1;
        }

        .child2 {
            background-color: aqua;
            width: 100px;
            flex: 1;
        }

        .child3 {
            background-color: aquamarine;
            flex: 2;
            width: 100px;
        } */
        * {
            padding: 0;
            margin: 0;
        }

        .root {
            width: 600px;
            height: 300px;
            display: flex;
        }

        .child1 {
            flex: 1 2 500px;
            background: red;
        }

        .child2 {
            flex: 2 1 400px;
            background: blue;
        }
    </style>
</head>

<body>
    <div class="root">
        <div class="child1"></div>
        <div class="child2"></div>
    </div>
</body>

</html>